import request from '@/utils/http'

// 获取我的订单列表
export const getMyOrderListAPI = (params) => {
  return request({
    url: '/member/order/list',
    params
  })
}

// 获取订单详情
export const getOrderDetailAPI = (id) => {
  return request({
    url: `/member/order/${id}`
  })
}

// 取消订单
export const cancelOrderAPI = (id, cancelReason) => {
  return request({
    url: `/member/order/${id}/cancel`,
    method: 'PUT',
    data: { cancelReason }
  })
}

// 删除订单
export const deleteOrderAPI = (id) => {
  return request({
    url: `/member/order/${id}`,
    method: 'DELETE'
  })
}

// 确认收货
export const confirmReceiptAPI = (id) => {
  return request({
    url: `/member/order/${id}/receipt`,
    method: 'PUT'
  })
}

// 获取物流信息
export const getLogisticsAPI = (id) => {
  return request({
    url: `/member/order/${id}/logistics`
  })
} 